package com.googlecode.afx.view.behavior;

import javafx.beans.value.ChangeListener;

/**
 * Interface for controlling the behavior and view state of elements within the view.
 * 
 * @author Martin
 *
 */
public interface ViewStateManager {

	/**
	 * Enables the node under the given <tt>nodeId</tt>.
	 * 
	 * @param nodeId
	 */
	public ViewStateManager enable(String nodeId);
	
	/**
	 * Enables the node under the given <tt>nodeId</tt>.
	 * 
	 * @param nodeId
	 */
	public ViewStateManager disable(String nodeId);
	
	/**
	 * Hides the node under the given <tt>nodeId</tt>.
	 * 
	 * @param nodeId
	 */
	public ViewStateManager hide(String nodeId);
	
	/**
	 * Shows the node under the given <tt>nodeId</tt>.
	 * 
	 * @param nodeId
	 */
	public ViewStateManager show(String nodeId);
	
	/**
	 * Installs a <tt>ChangeListener</tt> for the node under <tt>nodeId</tt>.
	 * 
	 * @param nodeId
	 * @param listener
	 */
	public <T> void install(String nodeId, ChangeListener<T> listener);
		
	/**
	 * Installs a <tt>ChangeListener</tt> for the node under <tt>nodeId</tt> for the property specified
	 * with <tt>propertyMethodName</tt>.
	 * 
	 * @param nodeId
	 * @param propertyMethodName
	 * @param listener
	 */
	public <T> void install(String nodeId, String propertyMethodName, ChangeListener<T> listener);
	
	/**
	 * Adds a defined <tt>ViewBehavior</tt> to this <tt>ViewStateManager</tt>.
	 * 
	 * @param viewBehavior
	 */
	public void addViewBehavior(ViewBehavior viewBehavior);
}
